<?php include_once 'util.php'; ?>
<?php include_once 'usercontroller.php'; ?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Trang chủ</title>
        <link href="css/frontpage.css" rel="stylesheet" type="text/css"/>
        <link href="css/lab.css" rel="stylesheet" type="text/css"/>
        <link href="css/css3buttons.css" rel="stylesheet" type="text/css"/>
        <link href="css/smallslider.css" rel="stylesheet" type="text/css"/>
        <link href="css/tipsy-docs.css" rel="stylesheet" type="text/css"/>
        <link href="css/tipsy.css" rel="stylesheet" type="text/css"/>
        <link href="js/uploadify2.4/uploadify.css" type="text/css" rel="stylesheet" />
        <link href="css/smoothness/jquery-ui-1.8.11.custom.css" type="text/css" rel="stylesheet"/>
        <link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
        <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
        <script type="text/javascript" src="js/jquery.smallslider.js"></script>        
        <script type="text/javascript" src="js/jquery.tipsy.js"></script>
        <script type="text/javascript" src="js/galleria-1.2.4.min.js"></script>
        <script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
        <script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>   
        <script type="text/javascript" src="js/jquery-ui-1.8.11.custom.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
        <script type="text/javascript" src="js/uploadify2.4/swfobject.js"></script>
        <script type="text/javascript" src="js/uploadify2.4/jquery.uploadify.v2.1.4.min.js"></script>
        <script type="text/javascript" src="js/jquery.timer.js"></script>
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>


        <script type="text/javascript">
            $(function(){
                $('#exp1').smallslider(); 
               $('.tipsy').tipsy({gravity: 's'});
               
               $(document).everyTime("12s", function(i) {                    
                    $.ajax({
                        url:"commentcontroller.php",
                        type:"GET",
                        data:{action:"get_log"},
                        success:function(data){                            
                            if(data != ""){              
                                $(".menu-left ul.activity li").slideUp("fast").remove();
                                $(".menu-left ul.activity").prepend(data);
                                $(".menu-left ul.activity li:first").fadeTo("slow",0).fadeTo("slow",1);
                                if($(".menu-left ul.activity li").length > 5){
                                    $(".menu-left ul.activity li:last").fadeTo("slow",0).remove();                                
                                }                               
                            }
                        }

                    });
                }, 0);
                $("body").click(function(){
                    $("ul.search-auto").find("li").remove();
                })
            })            
            function searchdata(e){
            $("ul.search-auto").find("li").remove();
                $.ajax({
                   url:"usercontroller.php?keyword="+e,
                   type:"GET",
                   success:function(data){                       
                       if(data != ""){    
                           $("ul.search-auto").find("li").remove();
                          $("ul.search-auto").append(data); 
                       }                       
                   }
                });
            }
        </script>
    </head>
    <body>
        <div id="wrapper">
            <div style="position: absolute;top:40px;right:20px;">
                
            </div>
            <div id="header-container">                
                <h1 id="pageLogo">
					<!--<img src="Images/icon/logo.png"/>-->
                </h1>
                <div id="headNav" class="clearfix">
                    <div class="lfloat">
                        <div class="notify_top_search" style="position: relative">
                            <input type="text" onkeyup="searchdata(this.value);" placeholder="Tìm kiếm thành viên" id="txtHeaderSearch" name="uid">
                            <ul class="search-auto">
                                
                            </ul>
                            <input type="hidden" value="all" name="page">
                            <button id="btnHeaderSearch"></button>
                        </div>
                    </div>
                    <div class="rfloat">
                        <ul>
                            <li><a href="index.php">Trang chủ</a></li>
                            <li><a href="news.php">Tin tức</a></li>
							<?php if(isset($_COOKIE["username"])){ ?>
                            <li><a href="changepassword.php">Đổi mật khẩu</a></li>                            
                            <li><a href="edituser.php">Sửa thông tin</a></li>
                            <li><a href="logout.php">Đăng xuất</a></li>
                            <?php }else{ ?>
                            <li><a href="login.php">Đăng nhập</a></li>
                            <li><a href="register.php">Đăng ký</a></li>
							<li><a href="about.php">About</a></li>
                            <?php } ?>							
                        </ul>
                    </div>
                </div>                
            </div>
            <div class="blackBar"></div>
            
